<!DOCTYPE html>
<html lang="en">

<head>
  <title></title>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">

  <!--<script src="./observer.js"></script>
    <script src="./watcher.js"></script>-->
  <script src="./index.js"></script>

</head>

<body>
    <h1 id="name" onclick="change()">{{name}}</h1>

</body>

</html>

<script type="text/javascript">
    var ele = document.querySelector('#name');
    var selfVue = new SelfVue({
        name: 'hello world'
    }, ele, 'name');

 
    // window.setTimeout(function () {
    //     console.log('name值改变了');
    //             selfVue.data.name = 'canfoo';

    // }, 2000);

    function change() {
       
        selfVue.data.name = 'canfoo';

    }
 
</script>
